﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GestionVentaInvetario2._0
{
    public partial class Caja : Form
    {
       

        public Caja()
        {
            InitializeComponent();
        }
        public void traertotal(int to) 
        {
            textBox1.Text = Convert.ToString(to);
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            
            int total = int.Parse(textBox1.Text);
            int pago = int.Parse(textBox2.Text);
            if (pago > total)
            {
                int vuelto = pago - total;
                textBox3.Text = Convert.ToString(vuelto);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
